#include<ros/ros.h>
#include<turtlesim/Spawn.h>


int main(int argc, char *argv[])
{
    
    setlocale(LC_ALL,"");
    ros::init(argc,argv,"guigui");
    ros::NodeHandle nh;

    ros::ServiceClient client= nh.serviceClient<turtlesim::Spawn>("/spawn");

    client.waitForExistence();

    turtlesim::Spawn req;
    req.request.x = 2.0;
    req.request.y = 2.0;
    req.request.theta = 8;
    req.request.name = "turtle2";
    
    bool flag = client.call(req);
    if (flag){
        ROS_INFO("龟龟创建成功 它叫%s",req.response.name.c_str());

    }else{
        ROS_INFO("龟龟创建失败啦！");
    }

    return 0;
}